home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL / gluperspective.z / gluperspective
Encoding:
Text File  |  2001-04-17  |  4.9 KB  |  129 lines

  1.  
  2.  
  3.  
  4. gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee((((3333GGGG))))             OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee             gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee - set up a perspective projection matrix
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee( GLdouble _f_o_v_y,
  14.                           GLdouble _a_s_p_e_c_t,
  15.                           GLdouble _z_N_e_a_r,
  16.                           GLdouble _z_F_a_r )
  17.  
  18.  
  19. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  20.      _f_o_v_y    Specifies the field of view angle, in degrees, in the _y
  21.              direction.
  22.  
  23.      _a_s_p_e_c_t  Specifies the aspect ratio that determines the field of view in
  24.              the _x direction.  The aspect ratio is the ratio of _x (width) to _y
  25.              (height).
  26.  
  27.      _z_N_e_a_r   Specifies the distance from the viewer to the near clipping plane
  28.              (always positive).
  29.  
  30.      _z_F_a_r    Specifies the distance from the viewer to the far clipping plane
  31.              (always positive).
  32.  
  33. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  34.      gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee specifies a viewing frustum into the world coordinate
  35.      system.  In general, the aspect ratio in gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee should match the
  36.      aspect ratio of the associated viewport. For example, aspect = 2.0 means
  37.      the viewer's angle of view is twice as wide in _x as it is in _y.  If the
  38.      viewport is twice as wide as it is tall, it displays the image without
  39.      distortion.
  40.  
  41.      The matrix generated by gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee is multipled by the current
  42.      matrix, just as if ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx were called with the generated matrix.
  43.      To load the perspective matrix onto the current matrix stack instead,
  44.      precede the call to gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee with a call to ggggllllLLLLooooaaaaddddIIIIddddeeeennnnttttiiiittttyyyy.
  45.  
  46.      Given _f defined as follows:
  47.  
  48.                                 f = cotangent( 2fovy____)
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee((((3333GGGG))))             OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee             gggglllluuuuPPPPeeeerrrrssssppppeeeeccccttttiiiivvvveeee((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      The generated matrix is
  75.  
  76.  
  77.  
  78.  
  79.                     (||||||(    000aspectf______  00f0      -1zNear-zFarzFar+zNear__________00            0zNear-zFar2*zFar*zNear____________00         )||||||)
  80. NNNNOOOOTTTTEEEESSSS
  81.      Depth buffer precision is affected by the values specified for _z_N_e_a_r and
  82.      _z_F_a_r.  The greater the ratio of _z_F_a_r to _z_N_e_a_r is, the less effective the
  83.      depth buffer will be at distinguishing between surfaces that are near
  84.      each other.  If
  85.  
  86.                                      r = zNearzFar_____
  87.  
  88.      roughly logr bits of depth buffer precision are lost.  Because r
  89.      approaches infinity as _z_N_e_a_r approaches 0, _z_N_e_a_r must never be set to 0.
  90.  
  91. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  92.      ggggllllFFFFrrrruuuussssttttuuuummmm, ggggllllLLLLooooaaaaddddIIIIddddeeeennnnttttiiiittttyyyy, ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx, gggglllluuuuOOOOrrrrtttthhhhoooo2222DDDD
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.                                                                         PPPPaaaaggggeeee 2222
  124.  
  125.  
  126.  
  127.